import org.springframework.web.servlet.support.RequestContextUtils as RCU;

class MyTestTagLib 
{
	def sayHappy = 
	{
		attrs, body ->
		out << (body() << (attrs.happy=="true"?"I am happy" : "I am not happy") )
	}
	
	def rept = 
	{
		attrs, body ->
		def counter = attrs?.ts.toInteger();
		counter.times
		{
			num ->
			out << body(num)
		}
	}
	
	def rept2 = 
	{
		attrs, body ->
		def counter = attrs?.ts.toInteger();
		def var = attrs.var?attrs.var:"num"
		counter.times
		{
			num ->
			out << body((var):num)
		}
	}
	
			 
}